//
//  CPNetManager.m
//  News
//
//  Created by chen on 15/3/27.
//  Copyright (c) 2015年 chen. All rights reserved.
//

#import "CPNetManager.h"

@interface CPNetManager()

@property (nonatomic, strong) CPNetwork *netWork;

@end

@implementation CPNetManager

- (CPNetwork *)netWork{
    if (_netWork == nil)
    {
        _netWork = [[CPNetwork alloc] init];
    }
    return _netWork;
    
}

static id instance;
+ (CPNetManager *)shared{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[self alloc] init];
    });
  
    return  instance;
}

- (void)requestJSON:(NSString *)baseURLString httpMethod:(HTTPMethod)method parameter:(NSDictionary *)parameter completionHandler:(Completion)completionHandler
{
    [self.netWork requestJSON:baseURLString httpMethod:method parameter:parameter completionHandler:completionHandler];
}


@end
